import React from "react";
import "../../../static/css/mobile/hot.css";
import NewsList from "../components/newslist";
import HeadList from "../components/header";
import {Row,Col,Carousel } from "antd";

export default class Hot extends React.Component{
	constructor(){
			super();
			this.state={
				topNews:[]
			}
		}
	componentDidMount(){
		var result=fetch("http://www.wwtliu.com/sxtstu/news/juhenews.php?type=top&count=5",{
			method:"get"
		})
		.then(res=>{
			return res.json();
		})
		.then(json=>{
			this.setState({
				topNews:json
			})
		})
	}
	render(){
		var {topNews} = this.state;
		return (
			<div>
				<HeadList />
				<div className="carouse">
					<Carousel>
				    {
				    	topNews.map((item,index) => {
							return <div key={index}><img src={item.thumbnail_pic_s} alt="图片"/></div>
						})
				    }
				 </Carousel>
				</div>
				<NewsList />
			</div>
		)
	}
}